<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script type="text/javascript">
function delproduct(ref){
	var r=confirm("Are you sure Delete This Product!");
	if (r==true){
		url = "<?php echo base_url()?>/addmincont/delProductC/";
		var data ={area:ref};
		$.ajax({
			type : 'POST',
			url: url,
			data:data,
			dataType:'html',
			success: function(result){
				if(result==1){
					alert('Delete Product Successfull');
					window.location.reload(true);
				}else{
					alert('Error connect to DB');
				}
			}
		});//end ajax
	}else{
		return false;
	}
}

</script>
<style>
<!--

-->
div.cellcatlist{border:1px solid #CCCCCC; height:140px; overflow:hidden;margin: 5px;color: maroon;}
div.cellcatlistnum{border:1px solid #CCCCCC; height:25px; overflow:hidden;margin: 5px; padding: 4px;}
.contentcate{
	width:797px;
	margin-left:5px;
	padding:5px;
	//border-collapse: collapse;
	border: 1px solid #b60909;
}
</style>
<?php
$limit = count($common);
if ($limit>0){
?>
<table class='contentcate'>
<?php 
	for ($i=0;$i<$limit;$i=$i+5){
		echo "<tr>";
			if (isset($common[$i]['cat_id'])){
				echo "<td><div class='cellcatlist'>";
					echo $common[$i]['cat_name']."<br>";
					echo '<img src="'.base_url().'public/images/'.$common[$i]['images'].'" class="statusicon" width="150" height="90">';
					echo '<br>'.anchor(base_url().'addmincont/editProductC/'.$common[$i]['cat_id'],'Edit').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//					echo anchor(base_url().'addmincont/delProductC/'.$common[$i]['cat_id'],'Delete');
					echo "<input type='button' value='Delete' onclick='delproduct(".$common[$i]['cat_id'].");' />";
				echo "</div></td>";
			}else echo "<td></td>";
			if (isset($common[$i+1]['cat_id'])){
				echo "<td><div class='cellcatlist'>";
					echo $common[$i+1]['cat_name']."<br>";
					echo '<img src="'.base_url().'public/images/'.$common[$i+1]['images'].'" class="statusicon" width="150" height="90">';
					echo '<br>'.anchor(base_url().'addmincont/editProductC/'.$common[$i+1]['cat_id'],'Edit').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//					echo anchor(base_url().'addmincont/delProductC/'.$common[$i+1]['cat_id'],'Delete');
					echo "<input type='button' value='Delete' onclick='delproduct(".$common[$i+1]['cat_id'].");' />";
				echo "</div></td>";
			}else echo "<td></td>";
			if (isset($common[$i+2]['cat_id'])){
				echo "<td><div class='cellcatlist'>";
					echo $common[$i+2]['cat_name']."<br>";
					echo '<img src="'.base_url().'public/images/'.$common[$i+2]['images'].'" class="statusicon" width="150" height="90">';
					echo '<br>'.anchor(base_url().'addmincont/editProductC/'.$common[$i+2]['cat_id'],'Edit').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//					echo anchor(base_url().'addmincont/delProductC/'.$common[$i+2]['cat_id'],'Delete');
					echo "<input type='button' value='Delete' onclick='delproduct(".$common[$i+2]['cat_id'].");' />";
				echo "</div></td>";
			}else echo "<td></td>";
			if (isset($common[$i+3]['cat_id'])){
				echo "<td><div class='cellcatlist'>";
					echo $common[$i+3]['cat_name']."<br>";
					echo '<img src="'.base_url().'public/images/'.$common[$i+3]['images'].'" class="statusicon" width="150" height="90">';
					echo '<br>'.anchor(base_url().'addmincont/editProductC/'.$common[$i+3]['cat_id'],'Edit').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//					echo anchor(base_url().'addmincont/delProductC/'.$common[$i+3]['cat_id'],'Delete');
					echo "<input type='button' value='Delete' onclick='delproduct(".$common[$i+3]['cat_id'].");' />";
				echo "</div></td>";
			}else echo "<td></td>";
			if (isset($common[$i+4]['cat_id'])){
				echo "<td><div class='cellcatlist'>";
					echo $common[$i+4]['cat_name']."<br>";
					echo '<img src="'.base_url().'public/images/'.$common[$i+4]['images'].'" class="statusicon" width="150" height="90">';
					echo '<br>'.anchor(base_url().'addmincont/editProductC/'.$common[$i+4]['cat_id'],'Edit').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//					echo anchor(base_url().'addmincont/delProductC/'.$common[$i+4]['cat_id'],'Delete');
					echo "<input type='button' value='Delete' onclick='delproduct(".$common[$i+4]['cat_id'].");' />";
				echo "</div></td>";
			}else echo "<td></td>";
		echo "</tr>";
	}
?>
	<tr>
		<td colspan="5"><div class='cellcatlistnum'>
			<?php 
//				echo "<input type='hidden' value='".$condition['cat_name']."' name='namep' id ='namep'/>";
//				echo "<input type='hidden' value='".$condition['cat_color']."' name='colorp' id ='colorp'/>";
//				echo "<input type='hidden' value='".$condition['cat_type_sub_id']."' name='typep' id ='typep'/>";
				echo $this->pagination->create_links(); 
			?>
		</div></td>
	</tr>
</table>
<?php 
}else echo '<h1>Emty Data</h1>';
?>